package com.hongkou.tvstation.common.exception;

import java.util.Arrays;

public class GenericException extends RuntimeException {
	private String errorMessage;

	public GenericException(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public GenericException(Exception e) {
		this.errorMessage = Arrays.toString(e.getStackTrace());
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public static GenericException parse(Exception e) {
		return new GenericException(e);
	}

	@Override
	public String toString() {
		return errorMessage;
	}
}
